<?php

	session_start();
	if(!($_SESSION["username"])||($_SESSION["role"]!="TUT")){
		//not logged in or tutor
		header("location:index.php");
	}
	
	$id=$_GET['id'];
	
	// Connect to server and select databse.
	mysql_connect("localhost", "root", "")or die("cannot connect"); 
	mysql_select_db("Project 5.5")or die("cannot select DB");
	
	$sql='UPDATE studentinfo SET Class_ID="0" WHERE Class_ID="'.$id.'"';
	$result=mysql_query($sql);
	
	$sql='DELETE FROM classes WHERE Class_ID="'.$id.'"';
	$result=mysql_query($sql);
	
	header("location:manageclasses.php?message=remove");
	
?>